﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BusinessLayer
{
    public class USLLSLBusiness
    {
        private decimal usl;
        private decimal lsl;

        public USLLSLBusiness(string testPlanID, string functionalTestID)
        {
            using (Production2Entities entity = new Production2Entities())
            {
                var result = (from ft in entity.V_CAL_Part_Functional_Test_All
                              where ft.test_series_id == testPlanID && ft.functional_test_id == functionalTestID
                              && ft.latest_record == "Y"
                              select new { ft.USL, ft.LSL }).FirstOrDefault();
                usl = result.USL;
                lsl = result.LSL;
            }
        }

        public decimal LSL
        {
            get { return lsl; }
        }

        public decimal USL
        {
            get { return usl; }
        }
    }
}
